import { Meta } from '@storybook/blocks';

<Meta title="Documentation/Release Flow" />

# Baklava Release Flow

We use semantic-release library for making our version releases automatically. With this library every commit to some branches automatically being analyzed and released with a semantic version if it's needed.

| Branch | Release Channel | Notes |
|--------|:---------------:|:-----:|
| main   | `latest` | Every push to `main` branch makes a stable release. |
| next   | `beta` | Every push to `next` branch triggers a beta release flow. |

When we have some commits that has `BREAKING CHANGE` strings in commit message, that push creates a `major` release in current channel. Backward incompatible changes should have breaking change commits. We'll
try to avoid making breaking changes as much as possible, but when we need them, maintainers will make a release plan for them. So breaking changes will not directly merged to `next` or `main` branches. We'll
create a new branch for that kind of works to collect them once we have our first stable release.

When we have some commits that has `feat` prefix in the message, that push creates a `minor` release that contains all of the changes.

When we have some commits that has `fix` prefix in the message and not any `feat` commits, that push creates a `patch` release that contains all of the changes.

With every release, we are publishing our version to our [NPM package](https://www.npmjs.com/package/@trendyol/baklava). Also semantic-release automatically creates a [GitHub Release](https://github.com/Trendyol/baklava/releases) with autogenerated Changelog in it. With the help of free public CDN services
like [jsDelivr](https://www.jsdelivr.com), [Unpkg](https://unpkg.com) or [cdnjs](https://cdnjs.com).

We are not pushing changes to `main` and `next` branches directly. `main` branch will only be updated by a PR from `next` branch that contains features/fixes that we are ready to release as stable release.
And all of the changes for the current version will be done in PRs targeting `next` branch. PRs are not making any release
